public class Main6 {
    public static void main(String[] args) {
        //删除数组中重复的数
        int[] arr = {1, 1, 1, 1, 2, 3, 0, 0};
        int j = 0;
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] != arr[j]) {
                j++;
                arr[j] = arr[i];
            }
        }
        for (int element : arr) {
            System.out.print(element + " ");
        }
        System.out.println("");
        for (int i = 0; i < j + 1; i++) {
            System.out.print(arr[i] + " ");
        }
    }
}
